
function kline(m,chart){
    data = chart.time_line
//$.getJSON('https://www.highcharts.com/samples/data/jsonp.php?filename=aapl-ohlcv.json&callback=?', function (data) {

	Highcharts.setOptions({

		/***/
		colors: ['#F01717', '#416C9E', '#DDDF0D', '#7798BF', '#55BF3B', '#DF5353', '#aaeeee', '#ff0066', '#eeaaee', '#55BF3B', '#DF5353', '#7798BF', '#aaeeee'],
		lang: {
			loading: 'Loading...',
			months: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
			shortMonths: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
			weekdays: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
			decimalPoint: '.',
			numericSymbols: ['k', 'M', 'G', 'T', 'P', 'E'],
			//resetZoom: 'Reset zoom',
			//resetZoomTitle: 'Reset zoom level 1:1',
			thousandsSep: ','
		},
		credits: {
			enabled: false,
		}

	});

    // split the data set into ohlc and volume
    var ohlc = [],
        volume = [],
        dataLength = data.length,
        // set the allowed units for data grouping
     groupingUnits = [[
	    'millisecond', // unit name
	    [1, 2, 5, 10, 20, 25, 50, 100, 200, 500] // allowed multiples
        ], [ 'second', [1, 2, 5, 10, 15, 30] ], [ 'minute', [1, 2, 5, 10, 15, 30] ]],
        i = 0;

    for (i; i < dataLength; i += 1) {
        ohlc.push([
            data[i][0], // the date
            data[i][1], // open
            data[i][2], // high
            data[i][3], // low
            data[i][4] // close
        ]);

        volume.push([
            data[i][0], // the date
            data[i][5] // the volume
        ]);
    }


    // create the chart
    Highcharts.stockChart('container', {

        //rangeSelector: {
        //    selected: 1
        //},

        title: {
            text: 'AAPL Historical'
        },

        yAxis: [{
            labels: {
                align: 'left',
                x: -3
            },
            title: {
                text: '价格'
            },
            height: '60%',
            lineWidth: 2,
            style: { color: '#CC3300' }
        }, {
            labels: {
                align: 'left',
                x: -3
            },
            title: {
                text: '数量'
            },
            top: '65%',
            height: '35%',
            offset: 0,
            lineWidth: 2,
            style: { color: '#4572A7' }
          
        }],

        tooltip: {
            split: true
        },

        series: [{
            type: 'candlestick',
            name: 'AAPL',
            data: ohlc,
            dataGrouping: {
                units: groupingUnits
            }
        }, 
        {
            type: 'column',
            name: 'Volume',
            data: volume,
            yAxis: 1,
            dataGrouping: {
                units: groupingUnits
            }
        },
        {
            name: 'AAPL',
            data: ohlc,
            //tooltip: {
            //    valueDecimals: 2
            //}
        }]
    });

}
	
